package com.example.administrator.jingpingou.view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.widget.TextView;

/**
 * Created by Administrator on 2016/8/29 0029.
 */
public class LineTextView extends TextView {
    private Paint mPaint;
    public LineTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mPaint=new Paint();
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        int paddingRight = getPaddingRight();
        int paddingLeft = getPaddingLeft();
        int paddingBottom = getPaddingBottom();
        int paddingTop = getPaddingTop();
        int width = getWidth();
        int height = getHeight();
        canvas.drawLine(paddingLeft,height/2,width-paddingRight,height/2,mPaint);
    }
}
